import request from '@/utils/axiosRequest'
import useEnv from "@/hooks/useEnv";
const show = useEnv.VITE_FILE_API + "/GetFileById?id="
const getReportTypes = () => {
    return request({
        url: '/ReportType/Get' 
    })
}
const getParentReportTypes = () => {
    return request({
        url: '/ReportType/GetParent'
    })
}

const addReportType = (data)=>{
    return request({
        url:'/ReportType/Add',
        data:data,
        method:'post'
    })
}
const editReportType = (data)=>{
    return request({
        url:'/ReportType/Update',
        data:data,
        method:'post'
    })
}

const getCommentReports = (x)=>{
    return request({
        url:'/CommentReport/GetBySelect?pageIndex='+x.pageIndex+'&pageSize='+x.pageSize+'&searchValue='+x.searchValue+
        '&extendedValue1='+x.extendedValue1+'&extendedValue2='+x.extendedValue2+'&extendedValue3='+x.extendedValue3
    })
}

const softDelete = (id)=>{
    return request({
        url:'/CommentReport/SoftDelete?id='+id,
        method:'delete'
    })
}

const updateCommentReport = (data)=>{
    return request({
        url:'/CommentReport/Examine',
        data:data,
        method:'post'
    })
}

const getPhotographReports = (x)=>{
    return request({
        url:'/PhotographReport/GetBySelect?pageIndex='+x.pageIndex+'&pageSize='+x.pageSize+'&searchValue='+x.searchValue+
        '&extendedValue1='+x.extendedValue1+'&extendedValue2='+x.extendedValue2+'&extendedValue3='+x.extendedValue3
    })
}

const updatePhotographReport = (data)=>{
    return request({
        url:'/PhotographReport/Examine',
        data:data,
        method:'post'
    })
}

const getPhotographById = (id)=>{
    return request({
        url:'/Photograph/GetById?id='+id
    })
}





export default{
    getParentReportTypes,
    getReportTypes,
    addReportType,
    editReportType,
    getCommentReports,
    softDelete,
    updateCommentReport,
    getPhotographReports,
    updatePhotographReport,
    getPhotographById,
    show
}